diff --git a/user_guide/nav/hacks.txt b/user_guide/nav/hacks.txt
new file mode 100644
index 0000000..f29e5a7
--- /dev/null
+++ b/user_guide/nav/hacks.txt
@@ -0,0 +1,9 @@
+I did the following hack in moo.fx.js:
+
+At line 79 in the toggle: function()  function, I added:
+
+document.getElementById('nav').style.display = 'block';
+
+
+
+-- Rick Ellis
\ No newline at end of file
diff --git a/user_guide/nav/moo.fx.js b/user_guide/nav/moo.fx.js
new file mode 100755
index 0000000..953e87c
--- /dev/null
+++ b/user_guide/nav/moo.fx.js
@@ -0,0 +1,119 @@
+/*
+moo.fx, simple effects library built with prototype.js (http://prototype.conio.net).
+by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE.
+for more info (http://moofx.mad4milk.net).
+10/24/2005
+v(1.0.2)
+*/
+
+//base
+var fx = new Object();
+fx.Base = function(){};
+fx.Base.prototype = {
+	setOptions: function(options) {
+	this.options = {
+		duration: 500,
+		onComplete: ''
+	}
+	Object.extend(this.options, options || {});
+	},
+
+	go: function() {
+		this.duration = this.options.duration;
+		this.startTime = (new Date).getTime();
+		this.timer = setInterval (this.step.bind(this), 13);
+	},
+
+	step: function() {
+		var time  = (new Date).getTime();
+		var Tpos   = (time - this.startTime) / (this.duration);
+		if (time >= this.duration+this.startTime) {
+			this.now = this.to;
+			clearInterval (this.timer);
+			this.timer = null;
+			if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10);
+		}
+		else {
+			this.now = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (this.to-this.from) + this.from;
+			//this time-position, sinoidal transition thing is from script.aculo.us
+		}
+		this.increase();
+	},
+
+	custom: function(from, to) {
+		if (this.timer != null) return;
+		this.from = from;
+		this.to = to;
+		this.go();
+	},
+
+	hide: function() {
+		this.now = 0;
+		this.increase();
+	},
+
+	clearTimer: function() {
+		clearInterval(this.timer);
+		this.timer = null;
+	}
+}
+
+//stretchers
+fx.Layout = Class.create();
+fx.Layout.prototype = Object.extend(new fx.Base(), {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.el.style.overflow = "hidden";
+		this.el.iniWidth = this.el.offsetWidth;
+		this.el.iniHeight = this.el.offsetHeight;
+		this.setOptions(options);
+	}
+});
+
+fx.Height = Class.create();
+Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), {	
+	increase: function() {
+		this.el.style.height = this.now + "px";
+	},
+
+	toggle: function() {
+		if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0);
+		else this.custom(0, this.el.scrollHeight);
+	}
+});
+
+fx.Width = Class.create();
+Object.extend(Object.extend(fx.Width.prototype, fx.Layout.prototype), {	
+	increase: function() {
+		this.el.style.width = this.now + "px";
+	},
+
+	toggle: function(){
+		if (this.el.offsetWidth > 0) this.custom(this.el.offsetWidth, 0);
+		else this.custom(0, this.el.iniWidth);
+	}
+});
+
+//fader
+fx.Opacity = Class.create();
+fx.Opacity.prototype = Object.extend(new fx.Base(), {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.now = 1;
+		this.increase();
+		this.setOptions(options);
+	},
+
+	increase: function() {
+		if (this.now == 1) this.now = 0.9999;
+		if (this.now > 0 && this.el.style.visibility == "hidden") this.el.style.visibility = "visible";
+		if (this.now == 0) this.el.style.visibility = "hidden";
+		if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + this.now*100 + ")";
+		this.el.style.opacity = this.now;
+	},
+
+	toggle: function() {
+		if (this.now > 0) this.custom(1, 0);
+		else this.custom(0, 1);
+	}
+});
\ No newline at end of file
diff --git a/user_guide/nav/moo.fx.pack.js b/user_guide/nav/moo.fx.pack.js
new file mode 100755
index 0000000..8b42283
--- /dev/null
+++ b/user_guide/nav/moo.fx.pack.js
@@ -0,0 +1,241 @@
+/*
+moo.fx pack, effects extensions for moo.fx.
+by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE
+for more info visit (http://moofx.mad4milk.net).
+Wednesday, November 16, 2005
+v1.0.4
+*/
+
+//text size modify, now works with pixels too.
+fx.Text = Class.create();
+fx.Text.prototype = Object.extend(new fx.Base(), {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.setOptions(options);
+		if (!this.options.unit) this.options.unit = "em";
+	},
+
+	increase: function() {
+		this.el.style.fontSize = this.now + this.options.unit;
+	}
+});
+
+//composition effect, calls Width and Height alltogheter
+fx.Resize = Class.create();
+fx.Resize.prototype = {
+	initialize: function(el, options) {
+		this.h = new fx.Height(el, options); 
+		if (options) options.onComplete = null;
+		this.w = new fx.Width(el, options);
+		this.el = $(el);
+	},
+
+	toggle: function(){
+		this.h.toggle();
+		this.w.toggle();
+	},
+
+	modify: function(hto, wto) {
+		this.h.custom(this.el.offsetHeight, this.el.offsetHeight + hto);
+		this.w.custom(this.el.offsetWidth, this.el.offsetWidth + wto);
+	},
+
+	custom: function(hto, wto) {
+		this.h.custom(this.el.offsetHeight, hto);
+		this.w.custom(this.el.offsetWidth, wto);
+	},
+
+	hide: function(){
+		this.h.hide();
+		this.w.hide();
+	}
+}
+
+//composition effect, calls Opacity and (Width and/or Height) alltogheter
+fx.FadeSize = Class.create();
+fx.FadeSize.prototype = {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.el.o = new fx.Opacity(el, options);
+		if (options) options.onComplete = null;
+		this.el.h = new fx.Height(el, options);
+		this.el.w = new fx.Width(el, options);
+	},
+
+	toggle: function() {
+		this.el.o.toggle();
+		for (var i = 0; i < arguments.length; i++) {
+			if (arguments[i] == 'height') this.el.h.toggle();
+			if (arguments[i] == 'width') this.el.w.toggle();
+		}
+	},
+
+	hide: function(){
+		this.el.o.hide();
+		for (var i = 0; i < arguments.length; i++) {
+			if (arguments[i] == 'height') this.el.h.hide();
+			if (arguments[i] == 'width') this.el.w.hide();
+		}
+	}
+}
+
+//intended to work with arrays.
+var Multi = new Object();
+Multi = function(){};
+Multi.prototype = {
+	initialize: function(elements, options){
+		this.options = options;
+		this.el = this.getElementsFromArray(elements);
+		for (i=0;i<this.el.length;i++){
+			this.effect(this.el[i]);
+		}
+	},
+
+	getElementsFromArray: function(array) {
+		var elements = new Array();
+		for (i=0;i<array.length;i++) { 
+			elements.push($(array[i])); 
+		}
+		return elements;
+	}
+}
+
+//Fadesize with arrays
+fx.MultiFadeSize = Class.create();
+fx.MultiFadeSize.prototype = Object.extend(new Multi(), {
+	effect: function(el){
+		el.fs = new fx.FadeSize(el, this.options);
+	},
+
+	showThisHideOpen: function(el, delay, mode){
+		for (i=0;i<this.el.length;i++){
+			if (this.el[i].offsetHeight > 0 && this.el[i] != el && this.el[i].h.timer == null && el.h.timer == null){
+				this.el[i].fs.toggle(mode);
+				setTimeout(function(){el.fs.toggle(mode);}.bind(el), delay);
+			}
+			
+		}
+	},
+
+	hide: function(el, mode){
+		el.fs.hide(mode);
+	}
+});
+
+var Remember = new Object();
+Remember = function(){};
+Remember.prototype = {
+	initialize: function(el, options){
+		this.el = $(el);
+		this.days = 365;
+		this.options = options;
+		this.effect();
+		var cookie = this.readCookie();
+		if (cookie) {
+			this.fx.now = cookie;
+			this.fx.increase();
+		}
+	},
+
+	//cookie functions based on code by Peter-Paul Koch
+	setCookie: function(value) {
+		var date = new Date();
+		date.setTime(date.getTime()+(this.days*24*60*60*1000));
+		var expires = "; expires="+date.toGMTString();
+		document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/";
+	},
+
+	readCookie: function() {
+		var nameEQ = this.el+this.el.id+this.prefix + "=";
+		var ca = document.cookie.split(';');
+		for(var i=0;i < ca.length;i++) {
+			var c = ca[i];
+			while (c.charAt(0)==' ') c = c.substring(1,c.length);
+			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+		}
+		return false;
+	},
+
+	custom: function(from, to){
+		if (this.fx.now != to) {
+			this.setCookie(to);
+			this.fx.custom(from, to);
+		}
+	}
+}
+
+fx.RememberHeight = Class.create();
+fx.RememberHeight.prototype = Object.extend(new Remember(), {
+	effect: function(){
+		this.fx = new fx.Height(this.el, this.options);
+		this.prefix = 'height';
+	},
+	
+	toggle: function(){
+		if (this.el.offsetHeight == 0) this.setCookie(this.el.scrollHeight);
+		else this.setCookie(0);
+		this.fx.toggle();
+	},
+	
+	resize: function(to){
+		this.setCookie(this.el.offsetHeight+to);
+		this.fx.custom(this.el.offsetHeight,this.el.offsetHeight+to);
+	},
+
+	hide: function(){
+		if (!this.readCookie()) {
+			this.fx.hide();
+		}
+	}
+});
+
+fx.RememberText = Class.create();
+fx.RememberText.prototype = Object.extend(new Remember(), {
+	effect: function(){
+		this.fx = new fx.Text(this.el, this.options);
+		this.prefix = 'text';
+	}
+});
+
+
+//use to attach effects without using js code, just classnames and rel attributes.
+ParseClassNames = Class.create();
+ParseClassNames.prototype = {
+	initialize: function(options){
+		var babies = document.getElementsByTagName('*') || document.all;
+		for (var i = 0; i < babies.length; i++) {
+			var el = babies[i];
+			//attach the effect, from the classNames;
+			var effects = this.getEffects(el);
+			for (var j = 0; j < effects.length; j++) {
+				if (j == 1 && options) options.onComplete = null;
+				el[effects[j]+"fx"] = new fx[effects[j]](el, options);
+			}
+			//execute methods, from rel
+			if (el.rel) {
+				el.crel = el.rel.split(' ');
+				if (el.crel[0].indexOf("fx_") > -1) {
+					var event = el.crel[0].replace('fx_', '');
+					var tocompute = this.getEffects($(el.crel[1]));
+					el["on"+event] = function(){
+						for (var f = 0; f < tocompute.length; f++) {
+							$(this.crel[1])[tocompute[f]+"fx"][this.crel[2] || "toggle"](this.crel[3] || null, this.crel[4] || null);
+						}
+					}
+				}
+			}
+		}
+	},
+
+	getEffects: function(el){
+		var effects = new Array();
+		var css = el.className.split(' ');
+		for (var i = 0; i < css.length; i++) {
+			if (css[i].indexOf('fx_') > -1) {
+				var effect = css[i].replace('fx_', '');
+				effects.push(effect);
+			}
+		}
+		return effects;
+	}
+}
\ No newline at end of file
diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js
new file mode 100644
index 0000000..d7e3fa8
--- /dev/null
+++ b/user_guide/nav/nav.js
@@ -0,0 +1,117 @@
+function create_menu(basepath)
+{
+	var base = (basepath == 'null') ? '' : basepath;
+
+	document.write(
+		'<table cellpadding="0" cellspaceing="0" border="0" style="width:98%"><tr>' +
+		'<td class="td" valign="top">' +
+
+		'<p><a href="'+base+'index.html">User Guide Home</a></p>' +	
+
+		'<h3>Basic Info</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'general/requirements.html">Server Requirements</a></li>' +
+			'<li><a href="'+base+'license.html">License Agreement</a></li>' +
+			'<li><a href="'+base+'general/changelog.html">Change Log</a></li>' +
+			'<li><a href="'+base+'general/credits.html">Credits</a></li>' +
+		'</ul>' +	
+		
+		'<h3>Installation</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'installation/downloads.html">Downloading Code Igniter</a></li>' +
+			'<li><a href="'+base+'installation/index.html">Installation Instructions</a></li>' +
+			'<li><a href="'+base+'installation/upgrading.html">Upgrading from a Previous Version</a></li>' +
+			'<li><a href="'+base+'troubleshooting.html">Troubleshooting</a></li>' +
+		'</ul>' +
+		
+		'<h3>Introduction</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'overview/at_a_glance.html">Code Igniter at a Glance</a></li>' +
+			'<li><a href="'+base+'overview/features.html">Supported Features</a></li>' +
+			'<li><a href="'+base+'overview/appflow.html">Application Flow Chart</a></li>' +
+			'<li><a href="'+base+'overview/mvc.html">Model-View-Controller</a></li>' +
+			'<li><a href="'+base+'overview/goals.html">Architectural Goals</a></li>' +
+		'</ul>' +	
+				
+		'</td><td class="td_sep" valign="top">' +
+
+		'<h3>General Topics</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'general/index.html">Getting Started</a></li>' +
+			'<li><a href="'+base+'general/urls.html">Code Igniter URLs</a></li>' +
+			'<li><a href="'+base+'general/controllers.html">Controllers</a></li>' +
+			'<li><a href="'+base+'general/views.html">Views</a></li>' +
+			'<li><a href="'+base+'general/models.html">Models</a></li>' +
+			'<li><a href="'+base+'general/helpers.html">Helpers</a></li>' +
+			'<li><a href="'+base+'general/plugins.html">Plugins</a></li>' +
+			'<li><a href="'+base+'general/libraries.html">Using Code Igniter Libraries</a></li>' +
+			'<li><a href="'+base+'general/creating_libraries.html">Creating Your Own Libraries</a></li>' +
+			'<li><a href="'+base+'general/core_classes.html">Creating Core Classes</a></li>' +
+			'<li><a href="'+base+'general/hooks.html">Hooks - Extending the Core</a></li>' +
+			'<li><a href="'+base+'general/autoloader.html">Auto-loading Resources</a></li>' +
+			'<li><a href="'+base+'general/scaffolding.html">Scaffolding</a></li>' +
+			'<li><a href="'+base+'general/routing.html">URI Routing</a></li>' +
+			'<li><a href="'+base+'general/errors.html">Error Handling</a></li>' +
+			'<li><a href="'+base+'general/caching.html">Web Page Caching</a></li>' +
+			'<li><a href="'+base+'general/multiple_apps.html">Running Multiple Applications</a></li>' +
+			'<li><a href="'+base+'general/alternative_php.html">Alternative PHP Syntax</a></li>' +
+			'<li><a href="'+base+'general/security.html">Security</a></li>' +
+		'</ul>' +
+		
+		'</td><td class="td_sep" valign="top">' +
+
+				
+		'<h3>Class Reference</h3>' +
+		'<ul>' +
+		'<li><a href="'+base+'libraries/benchmark.html">Benchmarking Class</a></li>' +
+		'<li><a href="'+base+'libraries/calendar.html">Calendaring Class</a></li>' +
+		'<li><a href="'+base+'libraries/config.html">Config Class</a></li>' +
+		'<li><a href="'+base+'database/index.html">Database Class</a></li>' +
+		'<li><a href="'+base+'libraries/email.html">Email Class</a></li>' +
+		'<li><a href="'+base+'libraries/encryption.html">Encryption Class</a></li>' +
+		'<li><a href="'+base+'libraries/file_uploading.html">File Uploading Class</a></li>' +
+		'<li><a href="'+base+'libraries/image_lib.html">Image Manipulation Class</a></li>' +		
+		'<li><a href="'+base+'libraries/input.html">Input and Security Class</a></li>' +
+		'<li><a href="'+base+'libraries/loader.html">Loader Class</a></li>' +
+		'<li><a href="'+base+'libraries/language.html">Language Class</a></li>' +
+		'<li><a href="'+base+'libraries/output.html">Output Class</a></li>' +
+		'<li><a href="'+base+'libraries/pagination.html">Pagination Class</a></li>' +
+		'<li><a href="'+base+'libraries/sessions.html">Session Class</a></li>' +
+		'<li><a href="'+base+'libraries/trackback.html">Trackback Class</a></li>' +
+		'<li><a href="'+base+'libraries/parser.html">Template Parser Class</a></li>' +
+		'<li><a href="'+base+'libraries/unit_testing.html">Unit Testing Class</a></li>' +
+		'<li><a href="'+base+'libraries/uri.html">URI Class</a></li>' +
+		'<li><a href="'+base+'libraries/validation.html">Validation Class</a></li>' +
+		'<li><a href="'+base+'libraries/xmlrpc.html">XML-RPC Class</a></li>' +
+		'</ul>' +
+
+		'</td><td class="td_sep" valign="top">' +
+
+		'<h3>Helper Reference</h3>' +
+		'<ul>' +
+		'<li><a href="'+base+'helpers/array_helper.html">Array Helper</a></li>' +
+		'<li><a href="'+base+'helpers/cookie_helper.html">Cookie Helper</a></li>' +
+		'<li><a href="'+base+'helpers/date_helper.html">Date Helper</a></li>' +
+		'<li><a href="'+base+'helpers/directory_helper.html">Directory Helper</a></li>' +
+		'<li><a href="'+base+'helpers/file_helper.html">File Helper</a></li>' +
+		'<li><a href="'+base+'helpers/form_helper.html">Form Helper</a></li>' +
+		'<li><a href="'+base+'helpers/html_helper.html">HTML Helper</a></li>' +
+		'<li><a href="'+base+'helpers/inflector_helper.html">Inflector Helper</a></li>' +
+		'<li><a href="'+base+'helpers/security_helper.html">Security Helper</a></li>' +
+		'<li><a href="'+base+'helpers/string_helper.html">String Helper</a></li>' +
+		'<li><a href="'+base+'helpers/text_helper.html">Text Helper</a></li>' +
+		'<li><a href="'+base+'helpers/typography_helper.html">Typography Helper</a></li>' +
+		'<li><a href="'+base+'helpers/url_helper.html">URL Helper</a></li>' +
+		'<li><a href="'+base+'helpers/xml_helper.html">XML Helper</a></li>' +
+		'</ul>' +	
+
+
+		'<h3>Additional Resources</h3>' +
+		'<ul>' +
+		'<li><a href="'+base+'general/quick_reference.html">Quick Reference Chart</a></li>' +
+		'<li><a href="http://www.codeigniter.com/forums/">Community Forums</a></li>' +
+		'<li><a href="http://www.codeigniter.com/wiki/">Community Wiki</a></li>' +
+		'</ul>' +	
+		
+		'</td></tr></table>');
+}
\ No newline at end of file
diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js
new file mode 100755
index 0000000..f1520e2
--- /dev/null
+++ b/user_guide/nav/prototype.lite.js
@@ -0,0 +1,127 @@
+/*  Prototype JavaScript framework
+ *  (c) 2005 Sam Stephenson <sam@conio.net>
+ *
+ *  Prototype is freely distributable under the terms of an MIT-style license.
+ *
+ *  For details, see the Prototype web site: http://prototype.conio.net/
+ *
+/*--------------------------------------------------------------------------*/
+
+
+//note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net).
+
+var Class = {
+  create: function() {
+    return function() { 
+      this.initialize.apply(this, arguments);
+    }
+  }
+}
+
+Object.extend = function(destination, source) {
+  for (property in source) {
+    destination[property] = source[property];
+  }
+  return destination;
+}
+
+Function.prototype.bind = function(object) {
+  var __method = this;
+  return function() {
+    return __method.apply(object, arguments);
+  }
+}
+
+function $() {
+  var elements = new Array();
+
+  for (var i = 0; i < arguments.length; i++) {
+    var element = arguments[i];
+    if (typeof element == 'string')
+      element = document.getElementById(element);
+
+    if (arguments.length == 1) 
+      return element;
+
+    elements.push(element);
+  }
+
+  return elements;
+}
+
+//-------------------------
+
+document.getElementsByClassName = function(className) {
+  var children = document.getElementsByTagName('*') || document.all;
+  var elements = new Array();
+  
+  for (var i = 0; i < children.length; i++) {
+    var child = children[i];
+    var classNames = child.className.split(' ');
+    for (var j = 0; j < classNames.length; j++) {
+      if (classNames[j] == className) {
+        elements.push(child);
+        break;
+      }
+    }
+  }
+  
+  return elements;
+}
+
+//-------------------------
+
+if (!window.Element) {
+  var Element = new Object();
+}
+
+Object.extend(Element, {
+  remove: function(element) {
+    element = $(element);
+    element.parentNode.removeChild(element);
+  },
+
+  hasClassName: function(element, className) {
+    element = $(element);
+    if (!element)
+      return;
+    var a = element.className.split(' ');
+    for (var i = 0; i < a.length; i++) {
+      if (a[i] == className)
+        return true;
+    }
+    return false;
+  },
+
+  addClassName: function(element, className) {
+    element = $(element);
+    Element.removeClassName(element, className);
+    element.className += ' ' + className;
+  },
+  
+  removeClassName: function(element, className) {
+    element = $(element);
+    if (!element)
+      return;
+    var newClassName = '';
+    var a = element.className.split(' ');
+    for (var i = 0; i < a.length; i++) {
+      if (a[i] != className) {
+        if (i > 0)
+          newClassName += ' ';
+        newClassName += a[i];
+      }
+    }
+    element.className = newClassName;
+  },
+  
+  // removes whitespace-only text node children
+  cleanWhitespace: function(element) {
+    element = $(element);
+    for (var i = 0; i < element.childNodes.length; i++) {
+      var node = element.childNodes[i];
+      if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
+        Element.remove(node);
+    }
+  }
+});
\ No newline at end of file
